package com.bdqn.service;

import com.bdqn.mapper.RoleMapper;
import com.bdqn.pojo.Role;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class RoleServiceImpl implements RoleService{

    @Resource
    RoleMapper roleMapper;

    public List<Role> getName(Map<String, Object> queryMap) {
        return roleMapper.getName(queryMap);
    }

    /**
     * 根据id获取角色
     * @param id
     * @return
     */
    @Override
    public Role find(Long id) {
        return roleMapper.find(id);
    }


    /**
     * 角色信息模糊分页搜索查询
     * @param queryMap
     * @return
     */
    @Override
    public List<Role> findList(Map<String, Object> queryMap) {
        return roleMapper.findList(queryMap);
    }

    /**
     * 角色信息模糊分页搜索查询总记录数
     * @param queryMap
     * @return
     */
    @Override
    public int getTotal(Map<String, Object> queryMap) {
        return roleMapper.getTotal(queryMap);
    }

    /**
     * 角色插入操作
     * @param role
     * @return
     */
    @Override
    public int add(Role role) {
        return roleMapper.add(role);
    }

    /**
     * 修改角色信息
     * @param role
     * @return
     */
    @Override
    public int edit(Role role) {
        return roleMapper.edit(role);
    }

    /**
     * 删除角色信息
     * @param id
     * @return
     */
    @Override
    public int delete(Long id) {
        return roleMapper.delete(id);
    }
}
